package com.rytx.system.service.impl;

import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.rytx.common.config.MyAliPayConfig;
import com.rytx.common.utils.alipay.AlipayConfigUtil;
import com.rytx.system.service.IAliConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AliConfigServiceImpl implements IAliConfigService {
    @Autowired
    private MyAliPayConfig myAliPayConfig;
    @Override
    public AlipayClient client() throws AlipayApiException {
        return new DefaultAlipayClient(AlipayConfigUtil.init(myAliPayConfig));
    }
}
